home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / taito_b.c < prev    next >
C/C++ Source or Header  |  2000-05-25  |  37KB  |  1,063 lines

  1. /***************************************************************************
  2.  
  3. Taito B System
  4.  
  5. heavily based on Taito F2 System driver by Brad Oliver, Andrew Prime
  6.  
  7.  
  8. The Taito F2 system is a fairly flexible hardware platform. It supports 4
  9. separate layers of graphics - one 64x64 tiled scrolling background plane
  10. of 8x8 tiles, a similar foreground plane, a sprite plane capable of handling
  11. all the video chores by itself (used in e.g. Super Space Invaders) and a text
  12. plane which may or may not scroll.
  13.  
  14. Sound is handled by a Z80 with a YM2610 connected to it.
  15.  
  16. The memory map for each of the games is similar but not identical.
  17.  
  18. Memory map for Rastan Saga 2 / Nastar / Nastar Warrior
  19.  
  20. CPU 1 : 68000, uses irqs 2 & 4. One of the IRQs just sets a flag which is
  21. checked in the other IRQ routine. Could be timed to vblank...
  22.  
  23.   0x000000 - 0x07ffff : ROM
  24.   0x200000 - 0x201fff : palette RAM, 4096 total colors
  25.   0x400000 - 0x403fff : 64x64 foreground layer (offsets 0x0000-0x1fff tile codes; offsets 0x2000-0x3fff tile attributes)
  26.   0x404000 - 0x807fff : 64x64 background layer (offsets 0x0000-0x1fff tile codes; offsets 0x2000-0x3fff tile attributes)
  27.   0x408000 - 0x408fff : 64x64 text layer
  28.   0x410000 - 0x41197f : ??k of sprite RAM (this is the range that Rastan Saga II tests at startup time)
  29.   0x413800 - 0x413fff : foreground control RAM (413800.w - foreground x scroll, 413802.w - foreground y scroll)
  30.   0x413c00 - 0x413fff : background control RAM (413c00.w - background x scroll, 413c02.w - background y scroll)
  31.  
  32.   0x600000 - 0x607fff : 32k of CPU RAM
  33.   0x800000 - 0x800003 : communication with sound CPU
  34.   0xa00000 - 0xa0000f : input ports and dipswitches (writes may be IRQ acknowledge)
  35.  
  36.  
  37.  
  38.  
  39. *XXX.1988 Rastan Saga II (B81, , )
  40.  
  41. Other possible B-Sys games:
  42.  
  43. Ashura Blaster
  44. Rambo 3
  45. Silent Dragon
  46. Tetris
  47. Violence Fight
  48. Hit The Ice (YM2203 sound - maybe not sysb?)
  49. Master of Weapons (YM2203 sound - maybe not sysb?)
  50.  
  51.  
  52. ***************************************************************************/
  53.  
  54. #include "driver.h"
  55. #include "cpu/m68000/m68000.h"
  56. #include "vidhrdw/generic.h"
  57.  
  58. extern unsigned char *taitob_fscroll;
  59. extern unsigned char *taitob_bscroll;
  60. extern unsigned char *b_backgroundram;
  61. extern size_t b_backgroundram_size;
  62. extern unsigned char *b_foregroundram;
  63. extern size_t b_foregroundram_size;
  64. extern unsigned char *b_textram;
  65. extern size_t b_textram_size;
  66. extern size_t b_paletteram_size;
  67. extern unsigned char *taitob_pixelram;
  68.  
  69.  
  70. #if 0
  71. extern unsigned char *b_rom;
  72. #endif
  73.  
  74. int taitob_vh_start (void);
  75. void taitob_vh_stop (void);
  76.  
  77. READ_HANDLER ( taitob_text_r );
  78. WRITE_HANDLER( taitob_text_w );
  79. READ_HANDLER ( taitob_background_r );
  80. WRITE_HANDLER( taitob_background_w );
  81. READ_HANDLER ( taitob_foreground_r );
  82. WRITE_HANDLER( taitob_foreground_w );
  83. void taitob_vh_screenrefresh (struct osd_bitmap *bitmap,int full_refresh);
  84. void crimec_vh_screenrefresh (struct osd_bitmap *bitmap,int full_refresh);
  85. void tetrist_vh_screenrefresh (struct osd_bitmap *bitmap,int full_refresh);
  86.  
  87.  
  88. WRITE_HANDLER( taitob_video_control_w );
  89.  
  90.  
  91. READ_HANDLER( tetrist_pixelram_r );
  92. WRITE_HANDLER( tetrist_pixelram_w );
  93.  
  94. WRITE_HANDLER( crimec_pixelram_w );
  95.  
  96.  
  97. READ_HANDLER ( ssi_videoram_r );
  98. WRITE_HANDLER( ssi_videoram_w );
  99.  
  100. WRITE_HANDLER( rastan_sound_port_w );
  101. WRITE_HANDLER( rastan_sound_comm_w );
  102. READ_HANDLER ( rastan_sound_comm_r );
  103.  
  104. WRITE_HANDLER( rastan_a000_w );
  105. WRITE_HANDLER( rastan_a001_w );
  106. READ_HANDLER ( rastan_a001_r );
  107.  
  108.  
  109. static WRITE_HANDLER( bankswitch_w )
  110. {
  111.     unsigned char *RAM = memory_region(REGION_CPU2);
  112.     int banknum = (data - 1) & 3;
  113.  
  114.     cpu_setbank (2, &RAM [0x10000 + (banknum * 0x4000)]);
  115. }
  116.  
  117.  
  118.  
  119. static READ_HANDLER( rastsag2_input_r )
  120. {
  121.     switch (offset)
  122.     {
  123.         case 0x00:
  124.             return readinputport (3)<<8; /*DSW A*/
  125.         case 0x02:
  126.             return readinputport (4)<<8; /*DSW B*/
  127.         case 0x04:
  128.             return readinputport (0)<<8; /*player 1*/
  129.         case 0x06:
  130.             return readinputport (1)<<8; /*player 2*/
  131.         case 0x0e:
  132.             return readinputport (2)<<8; /*tilt, coins*/
  133.         default:
  134.             return 0xff;
  135.     }
  136. }
  137.  
  138. void rsaga2_interrupt2(int x)
  139. {
  140.     cpu_cause_interrupt(0,MC68000_IRQ_2);
  141. }
  142.  
  143. static int rastansaga2_interrupt(void)
  144. {
  145.     timer_set(TIME_IN_CYCLES(5000,0),0,rsaga2_interrupt2);
  146.     return MC68000_IRQ_4;
  147. }
  148.  
  149. void crimec_interrupt3(int x)
  150. {
  151.     cpu_cause_interrupt(0,MC68000_IRQ_3);
  152. }
  153.  
  154. static int crimec_interrupt(void)
  155. {
  156.     timer_set(TIME_IN_CYCLES(5000,0),0,crimec_interrupt3);
  157.     return MC68000_IRQ_5;
  158. }
  159.  
  160.  
  161. static WRITE_HANDLER( taitob_sound_w )
  162. {
  163.     if (offset == 0)
  164.     {
  165.         /*logerror("sound_w off0 data=%04x\n",data);*/
  166.         rastan_sound_port_w (0, (data>>8) & 0xff);
  167.     }
  168.     else if (offset == 2)
  169.     {
  170.         /*logerror("sound_w off2 data=%04x\n",data);*/
  171.         rastan_sound_comm_w (0, (data>>8) & 0xff);
  172.     }
  173. }
  174.  
  175. static READ_HANDLER( taitob_sound_r )
  176. {
  177.     if (offset == 2)
  178.         return (rastan_sound_comm_r (0)<<8);
  179.     else return 0;
  180. }
  181.  
  182.  
  183. static READ_HANDLER( sound_hack_r )
  184. {
  185.     return YM2610_status_port_0_A_r (0) | 1;
  186. }
  187.  
  188. static struct MemoryReadAddress rastsag2_readmem[] =
  189. {
  190.     { 0x000000, 0x07ffff, MRA_ROM },
  191.     { 0x600000, 0x607fff, MRA_BANK1 },    /* Main RAM */
  192.     { 0x200000, 0x201fff, paletteram_word_r }, /*palette*/
  193.  
  194.     { 0x400000, 0x403fff, taitob_foreground_r },
  195.     { 0x404000, 0x407fff, taitob_background_r },
  196.     { 0x408000, 0x408fff, taitob_text_r }, /*text ram*/
  197.  
  198.     { 0x410000, 0x41197f, ssi_videoram_r },
  199.  
  200.     { 0x413800, 0x413bff, MRA_BANK3 }, //1st.w foreground x, 2nd.w foreground y scroll
  201.     { 0x413c00, 0x413fff, MRA_BANK4 }, //1st.w background x, 2nd.w background y scroll
  202.  
  203.     { 0xa00000, 0xa0000f, rastsag2_input_r },    /* DSW A/B, player inputs*/
  204.     { 0x800000, 0x800003, taitob_sound_r },
  205.     { -1 }  /* end of table */
  206. };
  207.  
  208. #if 0
  209. //patched
  210. static struct MemoryReadAddress rastsag2_readmem[] =
  211. {
  212.     { 0x000000, 0x07ffff, MRA_ROM },
  213.     { 0x600000, 0x607fff, MRA_BANK1 },    /* Main RAM */
  214.     { 0x200000, 0x201fff, MRA_NOP }, /*palette*/
  215.     { 0x400000, 0x403fff, MRA_NOP },
  216.     { 0x404000, 0x407fff, MRA_NOP },
  217.     { 0x408000, 0x408fff, MRA_NOP }, /*text ram*/
  218.     { 0x410000, 0x41197f, MRA_NOP },
  219.     { 0x413800, 0x413bff, MRA_NOP }, //1st.w foreground x, 2nd.w foreground y scroll
  220.     { 0x413c00, 0x413fff, MRA_NOP }, //1st.w background x, 2nd.w background y scroll
  221.     { 0xa00000, 0xa0000f, rastsag2_input_r },    /* DSW A/B, player inputs*/
  222.     { 0x800000, 0x800003, taitob_sound_r },
  223.     { -1 }  /* end of table */
  224. };
  225. #endif
  226.  
  227.  
  228. static struct MemoryWriteAddress rastsag2_writemem[] =
  229. {
  230.     { 0x000000, 0x07ffff, MWA_ROM },
  231.     { 0x600000, 0x607fff, MWA_BANK1 },    /* Main RAM */
  232.     { 0x200000, 0x201fff, paletteram_RRRRGGGGBBBBxxxx_word_w, &paletteram, &b_paletteram_size },
  233.  
  234.     { 0x400000, 0x403fff, taitob_foreground_w, &b_foregroundram, &b_foregroundram_size }, /* foreground layer */
  235.     { 0x404000, 0x407fff, taitob_background_w, &b_backgroundram, &b_backgroundram_size }, /* background layer */
  236.     { 0x408000, 0x408fff, taitob_text_w, &b_textram, &b_textram_size }, /* text layer */
  237.  
  238.     { 0x410000, 0x41197f, ssi_videoram_w, &videoram, &videoram_size  },
  239.  
  240.     { 0x413800, 0x413bff, MWA_BANK3, &taitob_fscroll }, //1st.w foreground x scroll, 2nd.w foreground y scroll
  241.     { 0x413c00, 0x413fff, MWA_BANK4, &taitob_bscroll }, //1st.w background x scroll, 2nd.w background y scroll
  242.  
  243.     { 0x41800e, 0x41800f, taitob_video_control_w },
  244.  
  245.     { 0xa00000, 0xa0000f, MWA_NOP }, // ??
  246.     { 0x800000, 0x800003, taitob_sound_w },
  247.     { -1 }  /* end of table */
  248. };
  249.  
  250. static struct MemoryReadAddress crimec_readmem[] =
  251. {
  252.     { 0x000000, 0x07ffff, MRA_ROM },
  253.     { 0xa00000, 0xa0ffff, MRA_BANK1 },    /* Main RAM */
  254.     { 0x800000, 0x801fff, paletteram_word_r }, /*palette*/
  255.  
  256.     { 0x400000, 0x403fff, taitob_foreground_r },
  257.     { 0x404000, 0x407fff, taitob_background_r },
  258.     { 0x408000, 0x408fff, taitob_text_r }, /*text ram*/
  259.  
  260.     { 0x410000, 0x41197f, ssi_videoram_r },
  261.  
  262.     { 0x413800, 0x413bff, MRA_BANK3 }, //1st.w foreground x, 2nd.w foreground y scroll
  263.     { 0x413c00, 0x413fff, MRA_BANK4 }, //1st.w background x, 2nd.w background y scroll
  264.  
  265.     { 0x200000, 0x20000f, rastsag2_input_r },    /* DSW A/B, player inputs*/
  266.     { 0x600000, 0x600003, taitob_sound_r },
  267.     { -1 }  /* end of table */
  268. };
  269.  
  270.  
  271. static struct MemoryWriteAddress crimec_writemem[] =
  272. {
  273.     { 0x000000, 0x07ffff, MWA_ROM },
  274.     { 0xa00000, 0xa0ffff, MWA_BANK1 },    /* Main RAM */
  275.     { 0x800000, 0x801fff, paletteram_RRRRGGGGBBBBxxxx_word_w, &paletteram, &b_paletteram_size },
  276.     { 0x400000, 0x403fff, taitob_foreground_w, &b_foregroundram, &b_foregroundram_size }, /* foreground layer */
  277.     { 0x404000, 0x407fff, taitob_background_w, &b_backgroundram, &b_backgroundram_size }, /* background layer */
  278.     { 0x408000, 0x408fff, taitob_text_w, &b_textram, &b_textram_size }, /* text layer */
  279.  
  280.     { 0x409000, 0x40ffff, MWA_NOP }, /* unused (just set to zero at startup), not read by the game */
  281.     { 0x410000, 0x41197f, ssi_videoram_w, &videoram, &videoram_size  },
  282.  
  283.     { 0x413800, 0x413bff, MWA_BANK3, &taitob_fscroll }, //1st.w foreground x scroll, 2nd.w foreground y scroll
  284.     { 0x413c00, 0x413fff, MWA_BANK4, &taitob_bscroll }, //1st.w background x scroll, 2nd.w background y scroll
  285.  
  286.     { 0x41800e, 0x41800f, taitob_video_control_w },
  287.  
  288.     { 0x440000, 0x47ffff, crimec_pixelram_w, &taitob_pixelram }, /* pixel layer */
  289.  
  290.     { 0x200000, 0x20000f, MWA_NOP }, /**/
  291.     { 0x600000, 0x600003, taitob_sound_w },
  292.     { -1 }  /* end of table */
  293. };
  294.  
  295. static struct MemoryReadAddress tetrist_readmem[] =
  296. {
  297.     { 0x000000, 0x07ffff, MRA_ROM },
  298.     { 0x800000, 0x807fff, MRA_BANK1 },    /* Main RAM */
  299.     { 0xa00000, 0xa01fff, paletteram_word_r }, /*palette*/
  300.  
  301.     { 0x400000, 0x403fff, taitob_foreground_r },
  302.     { 0x404000, 0x407fff, taitob_background_r },
  303.     { 0x408000, 0x408fff, taitob_text_r }, /*text ram*/
  304.  
  305.     { 0x440000, 0x47ffff, tetrist_pixelram_r },    /* Pixel Layer */
  306.  
  307.     { 0x410000, 0x41197f, ssi_videoram_r },
  308.  
  309.     { 0x413800, 0x413bff, MRA_BANK3 }, //1st.w foreground x, 2nd.w foreground y scroll
  310.     { 0x413c00, 0x413fff, MRA_BANK4 }, //1st.w background x, 2nd.w background y scroll
  311.  
  312.     { 0x600000, 0x60000f, rastsag2_input_r },    /* DSW A/B, player inputs*/
  313.     { 0x200000, 0x200003, taitob_sound_r },
  314.     { -1 }  /* end of table */
  315. };
  316.  
  317.  
  318. static struct MemoryWriteAddress tetrist_writemem[] =
  319. {
  320.     { 0x000000, 0x07ffff, MWA_ROM },
  321.     { 0x800000, 0x807fff, MWA_BANK1 },    /* Main RAM */
  322.     { 0xa00000, 0xa01fff, paletteram_RRRRGGGGBBBBxxxx_word_w, &paletteram, &b_paletteram_size },
  323.  
  324.     { 0x400000, 0x403fff, taitob_foreground_w, &b_foregroundram, &b_foregroundram_size }, /* foreground layer */
  325.     { 0x404000, 0x407fff, taitob_background_w, &b_backgroundram, &b_backgroundram_size }, /* background layer */
  326.     { 0x408000, 0x408fff, taitob_text_w, &b_textram, &b_textram_size }, /* text layer */
  327.  
  328.     { 0x440000, 0x47ffff, tetrist_pixelram_w, &taitob_pixelram }, /* pixel layer */
  329.  
  330.     { 0x410000, 0x41197f, ssi_videoram_w, &videoram, &videoram_size  },
  331.  
  332.     { 0x413800, 0x413bff, MWA_BANK3, &taitob_fscroll }, //1st.w foreground x scroll, 2nd.w foreground y scroll
  333.     { 0x413c00, 0x413fff, MWA_BANK4, &taitob_bscroll }, //1st.w background x scroll, 2nd.w background y scroll
  334.  
  335.     { 0x41800e, 0x41800f, taitob_video_control_w },
  336.  
  337.     { 0x600000, 0x60000f, MWA_NOP }, // ??
  338.     { 0x200000, 0x200003, taitob_sound_w },
  339.     { -1 }  /* end of table */
  340. };
  341.  
  342. static struct MemoryReadAddress sound_readmem[] =
  343. {
  344.     { 0x0000, 0x3fff, MRA_ROM },
  345.     { 0x4000, 0x7fff, MRA_BANK2 },
  346.     { 0xc000, 0xdfff, MRA_RAM },
  347.     { 0xe000, 0xe000, sound_hack_r },
  348. //    { 0xe000, 0xe000, YM2610_status_port_0_A_r },
  349.     { 0xe001, 0xe001, YM2610_read_port_0_r },
  350.     { 0xe002, 0xe002, YM2610_status_port_0_B_r },
  351.     { 0xe200, 0xe200, MRA_NOP },
  352.     { 0xe201, 0xe201, rastan_a001_r },
  353.     { 0xea00, 0xea00, MRA_NOP },
  354.     { -1 }  /* end of table */
  355. };
  356.  
  357. static struct MemoryWriteAddress sound_writemem[] =
  358. {
  359.     { 0x0000, 0x7fff, MWA_ROM },
  360.     { 0xc000, 0xdfff, MWA_RAM },
  361.     { 0xe000, 0xe000, YM2610_control_port_0_A_w },
  362.     { 0xe001, 0xe001, YM2610_data_port_0_A_w },
  363.     { 0xe002, 0xe002, YM2610_control_port_0_B_w },
  364.     { 0xe003, 0xe003, YM2610_data_port_0_B_w },
  365.     { 0xe200, 0xe200, rastan_a000_w },
  366.     { 0xe201, 0xe201, rastan_a001_w },
  367.     { 0xe400, 0xe403, MWA_NOP }, /* pan */
  368.     { 0xe600, 0xe600, MWA_NOP }, /* ? */
  369.     { 0xee00, 0xee00, MWA_NOP }, /* ? */
  370.     { 0xf000, 0xf000, MWA_NOP }, /* ? */
  371.     { 0xf200, 0xf200, bankswitch_w },
  372.     { -1 }  /* end of table */
  373. };
  374.  
  375.  
  376. INPUT_PORTS_START( rastsag2 )
  377.     PORT_START      /* IN0 */
  378.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER1 )
  379.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER1 )
  380.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER1 )
  381.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 )
  382.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
  383.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )
  384.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  385.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  386.  
  387.     PORT_START      /* IN1 */
  388.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
  389.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  390.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
  391.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  392.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  393.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  394.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  395.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  396.  
  397.     PORT_START      /* IN2 */
  398.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
  399.     PORT_BIT_IMPULSE( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1, 2 )
  400.     PORT_BIT_IMPULSE( 0x04, IP_ACTIVE_LOW, IPT_COIN1, 2 )
  401.     PORT_BIT_IMPULSE( 0x08, IP_ACTIVE_LOW, IPT_COIN2, 2 )
  402.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  403.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  404.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
  405.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
  406.  
  407.     PORT_START /* DSW A */
  408.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
  409.     PORT_DIPSETTING(    0x01, DEF_STR( Off ))
  410.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  411.     PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
  412.     PORT_DIPSETTING(    0x02, DEF_STR( Off ))
  413.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  414.     PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
  415.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )
  416.     PORT_DIPSETTING(    0x00, DEF_STR( Off ))
  417.     PORT_DIPSETTING(    0x08, DEF_STR( On ))
  418.     PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) )
  419.     PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
  420.     PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
  421.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )
  422.     PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
  423.     PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) )
  424.     PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
  425.     PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) )
  426.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )
  427.     PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
  428.  
  429.     PORT_START /* DSW B */
  430.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
  431.     PORT_DIPSETTING(    0x01, DEF_STR( Off ))
  432.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  433.     PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
  434.     PORT_DIPSETTING(    0x02, DEF_STR( Off ))
  435.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  436.     PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
  437.     PORT_DIPSETTING(    0x04, DEF_STR( Off ))
  438.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  439.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
  440.     PORT_DIPSETTING(    0x08, DEF_STR( Off ))
  441.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  442.     PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )
  443.     PORT_DIPSETTING(    0x30, "3" )
  444.     PORT_DIPSETTING(    0x20, "1" )
  445.     PORT_DIPSETTING(    0x10, "2" )
  446.     PORT_DIPSETTING(    0x00, "5" )
  447.     PORT_DIPNAME( 0x40, 0x40, "Allow Continue" )
  448.     PORT_DIPSETTING(    0x00, DEF_STR( Off ))
  449.     PORT_DIPSETTING(    0x40, DEF_STR( On ))
  450.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  451.     PORT_DIPSETTING(    0x80, DEF_STR( Off ))
  452.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  453.  
  454. INPUT_PORTS_END
  455.  
  456. INPUT_PORTS_START( crimec )
  457.     PORT_START      /* IN0 */
  458.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER1 )
  459.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER1 )
  460.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER1 )
  461.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 )
  462.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
  463.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )
  464.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  465.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  466.  
  467.     PORT_START      /* IN1 */
  468.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
  469.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  470.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
  471.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  472.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  473.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  474.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  475.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  476.  
  477.     PORT_START      /* IN2 */
  478.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
  479.     PORT_BIT_IMPULSE( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1, 2 )
  480.     PORT_BIT_IMPULSE( 0x04, IP_ACTIVE_LOW, IPT_COIN1, 2 )
  481.     PORT_BIT_IMPULSE( 0x08, IP_ACTIVE_LOW, IPT_COIN2, 2 )
  482.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  483.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  484.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
  485.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
  486.  
  487.     PORT_START /* DSW A */
  488.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
  489.     PORT_DIPSETTING(    0x01, DEF_STR( Off ))
  490.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  491.     PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
  492.     PORT_DIPSETTING(    0x02, DEF_STR( Off ))
  493.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  494.     PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
  495.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )
  496.     PORT_DIPSETTING(    0x00, DEF_STR( Off ))
  497.     PORT_DIPSETTING(    0x08, DEF_STR( On ))
  498.     PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) )
  499.     PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
  500.     PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
  501.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )
  502.     PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
  503.     PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) )
  504.     PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
  505.     PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) )
  506.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )
  507.     PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
  508.  
  509.     PORT_START /* DSW B */
  510.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
  511.     PORT_DIPSETTING(    0x01, DEF_STR( Off ))
  512.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  513.     PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
  514.     PORT_DIPSETTING(    0x02, DEF_STR( Off ))
  515.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  516.     PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
  517.     PORT_DIPSETTING(    0x04, DEF_STR( Off ))
  518.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  519.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
  520.     PORT_DIPSETTING(    0x08, DEF_STR( Off ))
  521.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  522.     PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )
  523.     PORT_DIPSETTING(    0x30, "3" )
  524.     PORT_DIPSETTING(    0x20, "1" )
  525.     PORT_DIPSETTING(    0x10, "2" )
  526.     PORT_DIPSETTING(    0x00, "5" )
  527.     PORT_DIPNAME( 0x40, 0x40, "Allow Continue" )
  528.     PORT_DIPSETTING(    0x00, DEF_STR( Off ))
  529.     PORT_DIPSETTING(    0x40, DEF_STR( On ))
  530.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  531.     PORT_DIPSETTING(    0x80, DEF_STR( Off ))
  532.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  533.  
  534. INPUT_PORTS_END
  535.  
  536. INPUT_PORTS_START( tetrist )
  537.     PORT_START      /* IN0 */
  538.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER1 )
  539.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER1 )
  540.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER1 )
  541.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER1 )
  542.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
  543.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )
  544.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  545.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  546.  
  547.     PORT_START      /* IN1 */
  548.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP    | IPF_8WAY | IPF_PLAYER2 )
  549.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN  | IPF_8WAY | IPF_PLAYER2 )
  550.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT  | IPF_8WAY | IPF_PLAYER2 )
  551.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_PLAYER2 )
  552.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  553.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  554.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  555.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  556.  
  557.     PORT_START      /* IN2 */
  558.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT )
  559.     PORT_BIT_IMPULSE( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1, 2 )
  560.     PORT_BIT_IMPULSE( 0x04, IP_ACTIVE_LOW, IPT_COIN1, 2 )
  561.     PORT_BIT_IMPULSE( 0x08, IP_ACTIVE_LOW, IPT_COIN2, 2 )
  562.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNKNOWN )
  563.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
  564.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
  565.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START2 )
  566.  
  567.     PORT_START /* DSW A */
  568.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
  569.     PORT_DIPSETTING(    0x01, DEF_STR( Off ))
  570.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  571.     PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
  572.     PORT_DIPSETTING(    0x02, DEF_STR( Off ))
  573.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  574.     PORT_SERVICE( 0x04, IP_ACTIVE_LOW )
  575.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Demo_Sounds ) )
  576.     PORT_DIPSETTING(    0x00, DEF_STR( Off ))
  577.     PORT_DIPSETTING(    0x08, DEF_STR( On ))
  578.     PORT_DIPNAME( 0x30, 0x30, DEF_STR( Coin_A ) )
  579.     PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
  580.     PORT_DIPSETTING(    0x30, DEF_STR( 1C_1C ) )
  581.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )
  582.     PORT_DIPSETTING(    0x20, DEF_STR( 1C_2C ) )
  583.     PORT_DIPNAME( 0xc0, 0xc0, DEF_STR( Coin_B ) )
  584.     PORT_DIPSETTING(    0x40, DEF_STR( 2C_1C ) )
  585.     PORT_DIPSETTING(    0xc0, DEF_STR( 1C_1C ) )
  586.     PORT_DIPSETTING(    0x00, DEF_STR( 2C_3C ) )
  587.     PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
  588.  
  589.     PORT_START /* DSW B */
  590.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) )
  591.     PORT_DIPSETTING(    0x01, DEF_STR( Off ))
  592.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  593.     PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) )
  594.     PORT_DIPSETTING(    0x02, DEF_STR( Off ))
  595.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  596.     PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) )
  597.     PORT_DIPSETTING(    0x04, DEF_STR( Off ))
  598.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  599.     PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) )
  600.     PORT_DIPSETTING(    0x08, DEF_STR( Off ))
  601.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  602.     PORT_DIPNAME( 0x30, 0x30, DEF_STR( Lives ) )
  603.     PORT_DIPSETTING(    0x30, "3" )
  604.     PORT_DIPSETTING(    0x20, "1" )
  605.     PORT_DIPSETTING(    0x10, "2" )
  606.     PORT_DIPSETTING(    0x00, "5" )
  607.     PORT_DIPNAME( 0x40, 0x40, "Allow Continue" )
  608.     PORT_DIPSETTING(    0x00, DEF_STR( Off ))
  609.     PORT_DIPSETTING(    0x40, DEF_STR( On ))
  610.     PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) )
  611.     PORT_DIPSETTING(    0x80, DEF_STR( Off ))
  612.     PORT_DIPSETTING(    0x00, DEF_STR( On ))
  613.  
  614. INPUT_PORTS_END
  615.  
  616. static struct GfxLayout tilelayout =
  617. {
  618.     16,16,    /* 16*16 tiles */
  619.     8192,    /* 8192 tiles */
  620.     4,    /* 4 bits per pixel */
  621.     { 0, 8 , 512*1024*8 , 512*1024*8+8},
  622.     { 0, 1, 2, 3, 4, 5, 6, 7, 128+0, 128+1, 128+2, 128+3, 128+4, 128+5, 128+6, 128+7 },
  623.     { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16, 16*16, 17*16, 18*16, 19*16, 20*16, 21*16, 22*16, 23*16 },
  624.     64*8    /* every sprite takes 64 consecutive bytes */
  625. };
  626. static struct GfxLayout charlayout =
  627. {
  628.     8,8,    /* 8*8 characters */
  629.     4096,    /* 4096 characters */
  630.     4,    /* 4 bits per pixel */
  631.     { 0, 8 , 512*1024*8 , 512*1024*8+8},
  632.     { 0, 1, 2, 3, 4, 5, 6, 7 },
  633.     { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
  634.     16*8    /* every sprite takes 16 consecutive bytes */
  635. };
  636.  
  637. static struct GfxDecodeInfo gfxdecodeinfo[] =
  638. {
  639.     { REGION_GFX1, 0x0, &charlayout,  0, 256 },  /* sprites & playfield */
  640.     { REGION_GFX1, 0x0, &tilelayout,  0, 256 },  /* sprites & playfield */
  641.     { -1 } /* end of array */
  642. };
  643.  
  644. #define ROM_S 128*1024
  645. static struct GfxLayout charlayout_tetrist =
  646. {
  647.     8,8,    /* 8*8 characters */
  648.     4096,    /* 4096 characters */
  649.     8,    /* 8 bits per pixel */
  650.     { 0, 1, 2, 3, 4, 5, 6, 7 }, /*bitplanes are _not_ separated*/
  651.     { 0, 8 , 128*1024*8 , 128*1024*8+8},
  652.     { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16 },
  653.     16*8    /* every sprite takes 16 consecutive bytes */
  654. };
  655.  
  656. static struct GfxDecodeInfo tetrist_gfxdecodeinfo[] =
  657. {
  658.     { REGION_GFX1, 0x0, &charlayout_tetrist,  0, 256 },  /* sprites & playfield */
  659.     { REGION_GFX1, 0x0, &charlayout_tetrist,  0, 256 },  /* sprites & playfield */
  660.     { -1 } /* end of array */
  661. };
  662.  
  663.  
  664. /* handler called by the YM2610 emulator when the internal timers cause an IRQ */
  665. static void irqhandler(int irq)
  666. {
  667.     cpu_set_irq_line(1,0,irq ? ASSERT_LINE : CLEAR_LINE);
  668. }
  669.  
  670.  
  671. static struct YM2610interface ym2610_interface_rsaga2 =
  672. {
  673.     1,    /* 1 chip */
  674.     8000000,    /* 8 MHz */
  675.     { 30 },
  676.     { 0 },
  677.     { 0 },
  678.     { 0 },
  679.     { 0 },
  680.     { irqhandler },
  681.     { REGION_SOUND1 },
  682.     { REGION_SOUND2 },
  683.     { YM3012_VOL(60,MIXER_PAN_LEFT,60,MIXER_PAN_RIGHT) }
  684. };
  685.  
  686. static struct YM2610interface ym2610_interface_crimec =
  687. {
  688.     1,    /* 1 chip */
  689.     8000000,    /* 8 MHz */
  690.     { 30 },
  691.     { 0 },
  692.     { 0 },
  693.     { 0 },
  694.     { 0 },
  695.     { irqhandler },
  696.     { REGION_SOUND1 },
  697.     { REGION_SOUND1 },
  698.     { YM3012_VOL(60,MIXER_PAN_LEFT,60,MIXER_PAN_RIGHT) }
  699. };
  700.  
  701. static struct MachineDriver machine_driver_rastsag2 =
  702. {
  703.     /* basic machine hardware */
  704.     {
  705.         {
  706.             CPU_M68000,
  707.             12000000,    /* 12 MHz */
  708.             rastsag2_readmem,rastsag2_writemem,0,0,
  709.             rastansaga2_interrupt,1
  710.         },
  711.         {
  712.             CPU_Z80,
  713.             4000000,    /* 4 MHz */
  714.             sound_readmem, sound_writemem,0,0,
  715.             ignore_interrupt,0    /* IRQs are triggered by the YM2610 */
  716.         }
  717.     },
  718.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  719.     1,
  720.     0,
  721.  
  722.     /* video hardware */
  723.     40*8, 32*8, { 0*8, 40*8-1, 2*8, 30*8-1 },
  724.  
  725.     gfxdecodeinfo,
  726.     4096, 4096,
  727.     0,
  728.  
  729.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  730.     0,
  731.     taitob_vh_start,
  732.     taitob_vh_stop,
  733.     taitob_vh_screenrefresh,
  734.  
  735.     /* sound hardware */
  736.     SOUND_SUPPORTS_STEREO,0,0,0,
  737.     {
  738.         {
  739.             SOUND_YM2610,
  740.             &ym2610_interface_rsaga2
  741.         }
  742.     }
  743. };
  744.  
  745. static struct MachineDriver machine_driver_crimec =
  746. {
  747.     /* basic machine hardware */
  748.     {
  749.         {
  750.             CPU_M68000,
  751.             12000000,    /* 12 MHz */
  752.             crimec_readmem,crimec_writemem,0,0,
  753.             crimec_interrupt,1
  754.         },
  755.         {
  756.             CPU_Z80,
  757.             4000000,    /* 4 MHz */
  758.             sound_readmem, sound_writemem,0,0,
  759.             ignore_interrupt,0    /* IRQs are triggered by the YM2610 */
  760.         }
  761.     },
  762.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  763.     10,
  764.     0,
  765.  
  766.     /* video hardware */
  767.     40*8, 32*8, { 0*8, 40*8-1, 2*8, 30*8-1 },
  768.  
  769.     gfxdecodeinfo,
  770.     4096, 4096,
  771.     0,
  772.  
  773.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  774.     0,
  775.     taitob_vh_start,
  776.     taitob_vh_stop,
  777.     crimec_vh_screenrefresh,
  778.  
  779.     /* sound hardware */
  780.     SOUND_SUPPORTS_STEREO,0,0,0,
  781.     {
  782.         {
  783.             SOUND_YM2610,
  784.             &ym2610_interface_crimec
  785.         }
  786.     }
  787. };
  788.  
  789. static struct MachineDriver machine_driver_tetrist =
  790. {
  791.     /* basic machine hardware */
  792.     {
  793.         {
  794.             CPU_M68000,
  795.             12000000,    /* 12 MHz ???*/
  796.             tetrist_readmem,tetrist_writemem,0,0,
  797.             rastansaga2_interrupt,1
  798.         },
  799.         {
  800.             CPU_Z80,
  801.             4000000,    /* 4 MHz */
  802.             sound_readmem, sound_writemem,0,0,
  803.             ignore_interrupt,0    /* IRQs are triggered by the YM2610 */
  804.         }
  805.     },
  806.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  807.     10,
  808.     0,
  809.  
  810.     /* video hardware */
  811.     40*8, 32*8, { 0*8, 40*8-1, 2*8, 30*8-1 },
  812.     /*64*8, 64*8, { 0*8, 64*8-1, 0*8, 64*8-1 },*/
  813.  
  814.     tetrist_gfxdecodeinfo,
  815.     4096, 4096,
  816.     0,
  817.  
  818.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  819.     0,
  820.     taitob_vh_start,
  821.     taitob_vh_stop,
  822.     tetrist_vh_screenrefresh,
  823.  
  824.     /* sound hardware */
  825.     SOUND_SUPPORTS_STEREO,0,0,0,
  826.     {
  827.         {
  828.             SOUND_YM2610,
  829.             &ym2610_interface_rsaga2
  830.         }
  831.     }
  832. };
  833.  
  834. static struct MachineDriver machine_driver_ashura =
  835. {
  836.     /* basic machine hardware */
  837.     {
  838.         {
  839.             CPU_M68000,
  840.             12000000,    /* 12 MHz */
  841.             rastsag2_readmem,rastsag2_writemem,0,0,
  842.             rastansaga2_interrupt,1
  843.         },
  844.         {
  845.             CPU_Z80,
  846.             4000000,    /* 4 MHz */
  847.             sound_readmem, sound_writemem,0,0,
  848.             ignore_interrupt,0    /* IRQs are triggered by the YM2610 */
  849.         }
  850.     },
  851.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  852.     10,
  853.     0,
  854.  
  855.     /* video hardware */
  856.     40*8, 32*8, { 0*8, 40*8-1, 2*8, 30*8-1 },
  857.  
  858.     gfxdecodeinfo,
  859.     4096, 4096,
  860.     0,
  861.  
  862.     VIDEO_TYPE_RASTER | VIDEO_MODIFIES_PALETTE,
  863.     0,
  864.     taitob_vh_start,
  865.     taitob_vh_stop,
  866.     taitob_vh_screenrefresh,
  867.  
  868.     /* sound hardware */
  869.     SOUND_SUPPORTS_STEREO,0,0,0,
  870.     {
  871.         {
  872.             SOUND_YM2610,
  873.             &ym2610_interface_crimec
  874.         }
  875.     }
  876. };
  877.  
  878.  
  879. /***************************************************************************
  880.  
  881.   Game driver(s)
  882.  
  883. ***************************************************************************/
  884.  
  885. ROM_START( rastsag2 )
  886.     ROM_REGION( 0x80000, REGION_CPU1 )     /* 512k for 68000 code */
  887.     ROM_LOAD_EVEN( "b81-08.50" , 0x00000, 0x20000, 0xd6da9169 )
  888.     ROM_LOAD_ODD ( "b81-07.bin", 0x00000, 0x20000, 0x8edf17d7 )
  889.     ROM_LOAD_EVEN( "b81-10.49" , 0x40000, 0x20000, 0x53f34344 )
  890.     ROM_LOAD_ODD ( "b81-09.30" , 0x40000, 0x20000, 0x630d34af )
  891.  
  892.     ROM_REGION( 0x1c000, REGION_CPU2 )     /* 64k for Z80 code */
  893.     ROM_LOAD( "b81-11.bin", 0x00000, 0x4000, 0x3704bf09 )
  894.     ROM_CONTINUE(           0x10000, 0xc000 ) /* banked stuff */
  895.  
  896.     ROM_REGION( 0x100000, REGION_GFX1 | REGIONFLAG_DISPOSE)      /* temporary space for graphics (disposed after conversion) */
  897.     ROM_LOAD( "b81-03.bin", 0x000000, 0x080000, 0x551b75e6 )
  898.     ROM_LOAD( "b81-04.bin", 0x080000, 0x080000, 0xcf734e12 )
  899.  
  900.     ROM_REGION( 0x80000, REGION_SOUND1 )    /* adpcm samples */
  901.     ROM_LOAD( "b81-01.bin", 0x00000, 0x80000, 0xb33f796b )
  902.  
  903.     ROM_REGION( 0x80000, REGION_SOUND2 )    /* DELTA-T samples */
  904.     ROM_LOAD( "b81-02.bin", 0x00000, 0x80000, 0x20ec3b86 )
  905. ROM_END
  906.  
  907. ROM_START( nastarw )
  908.     ROM_REGION( 0x80000, REGION_CPU1 )     /* 512k for 68000 code */
  909.     ROM_LOAD_EVEN( "b81-08.50" , 0x00000, 0x20000, 0xd6da9169 )
  910.     ROM_LOAD_ODD ( "b81-12.31",  0x00000, 0x20000, 0xf9d82741 )
  911.     ROM_LOAD_EVEN( "b81-10.49" , 0x40000, 0x20000, 0x53f34344 )
  912.     ROM_LOAD_ODD ( "b81-09.30" , 0x40000, 0x20000, 0x630d34af )
  913.  
  914.     ROM_REGION( 0x1c000, REGION_CPU2 )     /* 64k for Z80 code */
  915.     ROM_LOAD( "b81-11.bin", 0x00000, 0x4000, 0x3704bf09 )
  916.     ROM_CONTINUE(           0x10000, 0xc000 ) /* banked stuff */
  917.  
  918.     ROM_REGION( 0x100000, REGION_GFX1 | REGIONFLAG_DISPOSE)      /* temporary space for graphics (disposed after conversion) */
  919.     ROM_LOAD( "b81-03.bin", 0x000000, 0x080000, 0x551b75e6 )
  920.     ROM_LOAD( "b81-04.bin", 0x080000, 0x080000, 0xcf734e12 )
  921.  
  922.     ROM_REGION( 0x80000, REGION_SOUND1 )    /* adpcm samples */
  923.     ROM_LOAD( "b81-01.bin", 0x00000, 0x80000, 0xb33f796b )
  924.  
  925.     ROM_REGION( 0x80000, REGION_SOUND2 )    /* DELTA-T samples */
  926.     ROM_LOAD( "b81-02.bin", 0x00000, 0x80000, 0x20ec3b86 )
  927. ROM_END
  928.  
  929. ROM_START( nastar )
  930.     ROM_REGION( 0x80000, REGION_CPU1 )     /* 512k for 68000 code */
  931.     ROM_LOAD_EVEN( "b81-08.50" , 0x00000, 0x20000, 0xd6da9169 )
  932.     ROM_LOAD_ODD ( "b81-13.bin", 0x00000, 0x20000, 0x60d176fb )
  933.     ROM_LOAD_EVEN( "b81-10.49" , 0x40000, 0x20000, 0x53f34344 )
  934.     ROM_LOAD_ODD ( "b81-09.30" , 0x40000, 0x20000, 0x630d34af )
  935.  
  936.     ROM_REGION( 0x1c000, REGION_CPU2 )     /* 64k for Z80 code */
  937.     ROM_LOAD( "b81-11.bin", 0x00000, 0x4000, 0x3704bf09 )
  938.     ROM_CONTINUE(           0x10000, 0xc000 ) /* banked stuff */
  939.  
  940.     ROM_REGION( 0x100000, REGION_GFX1 | REGIONFLAG_DISPOSE)      /* temporary space for graphics (disposed after conversion) */
  941.     ROM_LOAD( "b81-03.bin", 0x000000, 0x080000, 0x551b75e6 )
  942.     ROM_LOAD( "b81-04.bin", 0x080000, 0x080000, 0xcf734e12 )
  943.  
  944.     ROM_REGION( 0x80000, REGION_SOUND1 )    /* adpcm samples */
  945.     ROM_LOAD( "b81-01.bin", 0x00000, 0x80000, 0xb33f796b )
  946.  
  947.     ROM_REGION( 0x80000, REGION_SOUND2 )    /* DELTA-T samples */
  948.     ROM_LOAD( "b81-02.bin", 0x00000, 0x80000, 0x20ec3b86 )
  949. ROM_END
  950.  
  951. ROM_START( crimecu )
  952.     ROM_REGION( 0x80000, REGION_CPU1 )     /* 512k for 68000 code */
  953.     ROM_LOAD_EVEN( "b99-07"   , 0x00000, 0x20000, 0x26e886e6 )
  954.     ROM_LOAD_ODD ( "b99-05"   , 0x00000, 0x20000, 0xff7f9a9d )
  955.     ROM_LOAD_EVEN( "b99-06"   , 0x40000, 0x20000, 0x1f26aa92 )
  956.     ROM_LOAD_ODD ( "b99_14-2" , 0x40000, 0x20000, 0x06cf8441 )
  957.  
  958.     ROM_REGION( 0x1c000, REGION_CPU2 )     /* 64k for Z80 code */
  959.     ROM_LOAD( "b99-08", 0x00000, 0x4000, 0x26135451 )
  960.     ROM_CONTINUE(       0x10000, 0xc000 ) /* banked stuff */
  961.  
  962.     ROM_REGION( 0x100000, REGION_GFX1 | REGIONFLAG_DISPOSE)      /* temporary space for graphics (disposed after conversion) */
  963.     ROM_LOAD( "b99-02.ch1", 0x000000, 0x080000, 0x2a5d4a26 )
  964.     ROM_LOAD( "b99-01.ch0", 0x080000, 0x080000, 0xa19e373a )
  965.  
  966.     ROM_REGION( 0x80000, REGION_SOUND1 )    /* adpcm samples */
  967.     ROM_LOAD( "b99-03.roa", 0x00000, 0x80000, 0xdda10df7 )
  968. ROM_END
  969.  
  970. ROM_START( crimec )
  971.     ROM_REGION( 0x80000, REGION_CPU1 )     /* 512k for 68000 code */
  972.     ROM_LOAD_EVEN( "b99-07"   , 0x00000, 0x20000, 0x26e886e6 )
  973.     ROM_LOAD_ODD ( "b99-05"   , 0x00000, 0x20000, 0xff7f9a9d )
  974.     ROM_LOAD_EVEN( "b99-06"   , 0x40000, 0x20000, 0x1f26aa92 )
  975.     ROM_LOAD_ODD ( "b99-14"   , 0x40000, 0x20000, 0x71c8b4d7 )
  976.  
  977.     ROM_REGION( 0x1c000, REGION_CPU2 )     /* 64k for Z80 code */
  978.     ROM_LOAD( "b99-08", 0x00000, 0x4000, 0x26135451 )
  979.     ROM_CONTINUE(       0x10000, 0xc000 ) /* banked stuff */
  980.  
  981.     ROM_REGION( 0x100000, REGION_GFX1 | REGIONFLAG_DISPOSE)      /* temporary space for graphics (disposed after conversion) */
  982.     ROM_LOAD( "b99-02.ch1", 0x000000, 0x080000, 0x2a5d4a26 )
  983.     ROM_LOAD( "b99-01.ch0", 0x080000, 0x080000, 0xa19e373a )
  984.  
  985.     ROM_REGION( 0x80000, REGION_SOUND1 )    /* adpcm samples */
  986.     ROM_LOAD( "b99-03.roa", 0x00000, 0x80000, 0xdda10df7 )
  987. ROM_END
  988.  
  989. ROM_START( crimecj )
  990.     ROM_REGION( 0x80000, REGION_CPU1 )     /* 512k for 68000 code */
  991.     ROM_LOAD_EVEN( "b99-07"   , 0x00000, 0x20000, 0x26e886e6 )
  992.     ROM_LOAD_ODD ( "b99-05"   , 0x00000, 0x20000, 0xff7f9a9d )
  993.     ROM_LOAD_EVEN( "b99-06"   , 0x40000, 0x20000, 0x1f26aa92 )
  994.     ROM_LOAD_ODD ( "15"       , 0x40000, 0x20000, 0xe8c1e56d )
  995.  
  996.     ROM_REGION( 0x1c000, REGION_CPU2 )     /* 64k for Z80 code */
  997.     ROM_LOAD( "b99-08", 0x00000, 0x4000, 0x26135451 )
  998.     ROM_CONTINUE(       0x10000, 0xc000 ) /* banked stuff */
  999.  
  1000.     ROM_REGION( 0x100000, REGION_GFX1 | REGIONFLAG_DISPOSE)      /* temporary space for graphics (disposed after conversion) */
  1001.     ROM_LOAD( "b99-02.ch1", 0x000000, 0x080000, 0x2a5d4a26 )
  1002.     ROM_LOAD( "b99-01.ch0", 0x080000, 0x080000, 0xa19e373a )
  1003.  
  1004.     ROM_REGION( 0x80000, REGION_SOUND1 )    /* adpcm samples */
  1005.     ROM_LOAD( "b99-03.roa", 0x00000, 0x80000, 0xdda10df7 )
  1006. ROM_END
  1007.  
  1008. ROM_START( ashura )
  1009.     ROM_REGION( 0x80000, REGION_CPU1 )     /* 512k for 68000 code */
  1010.     ROM_LOAD_EVEN( "c4307-1.50"   , 0x00000, 0x20000, 0xd5ceb20f )
  1011.     ROM_LOAD_ODD ( "c4305-1.31"   , 0x00000, 0x20000, 0xa6f3bb37 )
  1012.     ROM_LOAD_EVEN( "c4306-1.49"   , 0x40000, 0x20000, 0x0f331802 )
  1013.     ROM_LOAD_ODD ( "c4304-1.30"   , 0x40000, 0x20000, 0xe06a2414 )
  1014.  
  1015.     ROM_REGION( 0x1c000, REGION_CPU2 )     /* 64k for Z80 code */
  1016.     ROM_LOAD( "ashura37.bin", 0x00000, 0x4000, 0xcb26fce1 )
  1017.     ROM_CONTINUE(             0x10000, 0xc000 ) /* banked stuff */
  1018.  
  1019.     ROM_REGION( 0x100000, REGION_GFX1 | REGIONFLAG_DISPOSE)      /* temporary space for graphics (disposed after conversion) */
  1020.     ROM_LOAD( "ashura1.bin", 0x000000, 0x080000, 0x105722ae )
  1021.     ROM_LOAD( "ashura0.bin", 0x080000, 0x080000, 0x426606ba )
  1022.  
  1023.     ROM_REGION( 0x80000, REGION_SOUND1 )    /* adpcm samples */
  1024.     ROM_LOAD( "ashura2.bin", 0x00000, 0x80000, 0xdb953f37 )
  1025.  
  1026. //other sound region?
  1027.  
  1028. ROM_END
  1029.  
  1030. ROM_START( tetrist )
  1031.     ROM_REGION( 0x80000, REGION_CPU1 )     /* 512k for 68000 code */
  1032.     ROM_LOAD_EVEN( "c12-03.bin", 0x000000, 0x020000, 0x38f1ed41 )
  1033.     ROM_LOAD_ODD ( "c12-02.bin", 0x000000, 0x020000, 0xed9530bc )
  1034.     ROM_LOAD_EVEN( "c12-05.bin", 0x040000, 0x020000, 0x128e9927 )
  1035.     ROM_LOAD_ODD ( "c12-04.bin", 0x040000, 0x020000, 0x5da7a319 )
  1036.  
  1037.     ROM_REGION( 0x1c000, REGION_CPU2 )     /* 64k for Z80 code */
  1038.     ROM_LOAD( "c12-06.bin", 0x00000, 0x4000, 0xf2814b38 )
  1039.     ROM_CONTINUE(           0x10000, 0xc000 ) /* banked stuff */
  1040.  
  1041.     ROM_REGION( 0x40000, REGION_GFX1 | REGIONFLAG_DISPOSE)      /* temporary space for graphics (disposed after conversion) */
  1042.     ROM_LOAD( "c12-04.bin", 0x000000, 0x020000, 0x5da7a319 )
  1043.     ROM_LOAD( "c12-05.bin", 0x020000, 0x020000, 0x128e9927 )
  1044.  
  1045.     ROM_REGION( 0x80000, REGION_SOUND1 )    /* adpcm samples */
  1046.     /* empty */
  1047.  
  1048.     ROM_REGION( 0x80000, REGION_SOUND2 )    /* DELTA-T samples */
  1049.     /* empty */
  1050. ROM_END
  1051.  
  1052.  
  1053.  
  1054. GAMEX( 1988, nastar,   0,      rastsag2, rastsag2, 0, ROT0,       "Taito Corporation Japan", "Nastar (World)", GAME_NO_COCKTAIL)
  1055. GAMEX( 1988, nastarw,  nastar, rastsag2, rastsag2, 0, ROT0,       "Taito America Corporation", "Nastar Warrior (US)", GAME_NO_COCKTAIL)
  1056. GAMEX( 1988, rastsag2, nastar, rastsag2, rastsag2, 0, ROT0,       "Taito Corporation", "Rastan Saga 2 (Japan)", GAME_NO_COCKTAIL)
  1057. GAMEX( 1989, crimec,   0,      crimec,   crimec,   0, ROT0_16BIT, "Taito Corporation Japan", "Crime City (World)", GAME_NO_COCKTAIL)
  1058. GAMEX( 1989, crimecu,  crimec, crimec,   crimec,   0, ROT0_16BIT, "Taito America Corporation", "Crime City (US)", GAME_NO_COCKTAIL)
  1059. GAMEX( 1989, crimecj,  crimec, crimec,   crimec,   0, ROT0_16BIT, "Taito Corporation", "Crime City (Japan)", GAME_NO_COCKTAIL)
  1060. GAMEX( 1989, tetrist,  tetris, tetrist,  tetrist,  0, ROT0_16BIT, "Sega", "Tetris (Japan, B-System)", GAME_NO_COCKTAIL)
  1061.  
  1062. GAMEX( 1990, ashura,   0,      ashura,   rastsag2, 0, ROT270,     "Taito Corporation", "Ashura Blaster (Japan)", GAME_NO_COCKTAIL)
  1063.